// $Id$
/*
 *  Copyright (C) 2007 NourY Solutions
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 3 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 */
/*! \file
 * \brief Definition of \c Salamanca.IBackupable.
 *
 * \author $Author$
 * \date $Date$
 * \version $Revision$
 */

using System;
using System.Collections.Generic;
using System.Text;

namespace Salamanca
{



    ///////////////////////////////////////////////////////////////////////////
    ///
    /// <summary>Interface implemented by a data bag.</summary>
    ///
    ///////////////////////////////////////////////////////////////////////////

    public interface IDataBag<T>
    {
        /// <summary>The data.</summary>
        T Data { get; set; }
    }



    ///////////////////////////////////////////////////////////////////////////
    ///
    /// <summary>Interface implemented by a list bag.</summary>
    ///
    ///////////////////////////////////////////////////////////////////////////

    public interface IListBag<T>:
        IDataBag<IList<T>>
    {
    }



    ///////////////////////////////////////////////////////////////////////////
    ///
    /// <summary>Implementation of a simple data bag.</summary>
    ///
    ///////////////////////////////////////////////////////////////////////////

    public sealed class SimpleBag<T>:
        IDataBag<T>
    {

        /// <summary>Initializes a new instance of the <see cref="SimpleBag{T}" /> class.</summary>
        public SimpleBag()
        {
        }

        /// <summary>Initializes a new instance of the <see cref="SimpleBag{T}" /> class.</summary>
        public SimpleBag(T data)
        {
            _Data=data;
        }

        /// <summary>The data.</summary>
        public T Data
        {
            get
            {
                return _Data;
            }
            set
            {
                _Data=value;
            }
        }

        /// <summary>The data.</summary>
        private T _Data;
    }

}
